import { defineStore } from 'pinia';
interface UserInfoType {
  adminEmail: string
  adminId: number
  adminName: string
  adminPhone: string
  adminPwd: null
  adminState: number
  roleId: number
}
interface StateType {
  token: string,
  userInfo: UserInfoType | { adminName: '' }
}

export const useTokenStore = defineStore('token', {
  state: (): StateType => {
    return { token: '', userInfo: { adminName: '' } }
  },
  getters: {
    getToken: (state) => state.token,
    getUserName: (state): string => state.userInfo.adminName
  },
  actions: {
    setToken(payload: string) {
      console.log("1231");
      // 
      this.token = payload;
    }
  }
})